Finding 0 al Solutions to the Twenty-Four Puzzle

نویسندگان

  • Richard E. Korf
  • Larry A. Taylor
چکیده

We have found the first optimal solutions to random instances of the Twenty-Four Puzzle, the 5 x 5 version of the well-known sliding-tile puzzles. Our new contribution to this problem is a more powerful admissible heuristic function. We present a general theory for the automatic discovery of such heuristics, which is based on considering multiple subgoals simultaneously. In addition, we apply a technique for pruning duplicate nodes in depth-first search using a finitestate machine. Finally, we observe that as heuristic search problems are scaled up, more powerful heuristic functions become both necessary and cost-effective. I I I I I IO 11 12 13 14 Introduction 20 21 22 23 24 The sliding-tile puzzles, such as the Eight and Fifteen Puzzle, have long served as testbeds for heuristic search in AI. A square frame is filled with numbered tiles, leaving one position empty, called the blank. Any tile that is horizontally or vertically adjacent to the blank can be slid into the blank position. The task is to rearrange the tiles from some random initial configuration into a particular goal configuration, ideally or optimally in a minimum number of moves. The state space for the Eight Puzzle contains over lo5 nodes, the Fifteen Puzzle space contains about 1013 nodes, and the Twenty-Four Puzzle contains almost 1O25 nodes. Figure 1: The Twenty-Four Puzzle in its goal state threshold for each succeeding iteration is the minimum total cost, f(n) = g(n)+h(n), of all nodes on the frontier of the previous iteration. The algorithm continues until a goal node is chosen for expansion. Due to its small search space, optimal solutions to the Eight Puzzle can be found with breadth-first search. We first found optimal solutions to the Fifteen Puzzle using Iterative-Deepening-A* (IDA*) and the Manhattan distance heuristic function (Korf 1985). IDA* is a variant of the well-known A* algorithm (Hart, Nilsson, and Rafael 1968), which runs in space that is linear in the maximum search depth, rather than exponential. IDA* proceeds in a series of depthfirst search iterations, starting from the initial state. Each path is explored until a node n is reached where the number of moves from the initial state, g(n), plus the heuristic estimate of the number of moves necessary to reach the goal state, h(n), exceeds a threshold for that iteration. The threshold for the first iteration is the heuristic estimate for the initial state, and the The Manhattan distance heuristic is computed by taking each tile, counting the number of grid units to its goal location, and then summing these values for all tiles. Since only one tile can move at a time, Manhattan distance never overestimates the number of moves needed to solve a given problem. Given such an admissible heuristic function, IDA* is guaranteed to return an optimal solution, if one exists. IDA* with the Manhattan distance heuristic can solve random instances of the Fifteen Puzzle (Korf 1985). In spite of considerable work on this problem in the last decade, however, nobody has solved a significantly larger version of the puzzle. Note that the state space of the Twenty-Four Puzzle is almost a trillion times larger than that of the Fifteen Puzzle. We present the first random Twenty-Four Puzzle instances for which optimal solutions have been found. Ten random solvable instances were generated, and so far we have found optimal solutions to all but one. 1202 Planning From: AAAI-96 Proceedings. Copyright © 1996, AAAI (www.aaai.org). All rights reserved. Three factors have contributed to this limited success. The first is simply faster computers. The Sun Ultra Spare workstation that these experiments were run on is about 70 times faster than the DEC 2060 that the Fifteen Puzzle was originally solved on. The second is a technique we developed for pruning duplicate nodes in depth-first search (Taylor and Korf 1993). Finally, we have discovered more powerful heuristic functions for this problem. The most important contribution of this paper, however, is a new theory that allows these heuristics to be automatically learned and applied. All examples in this paper refer to the Twenty-Four Puzzle, where positions are labelled by the tiles that occupy them in the goal state shown in Figure 1. Improved Admissible Heuristics Linear Conflict Heuristic The first significant improvement to Manhattan distance was the linear-conflict heuristic (Hansson, Mayer, and Yung 1992). It applies when two tiles are in their goal row or column, but are reversed relative to their goal positions. For example, if the top row of the puzzle contains the tiles (2 1) in that order, to reverse them, one of the tiles must move down out of the top row, to allow the other to pass by, and then back up. Since these two moves are not counted in the Manhattan distance of either tile, two moves can be added to Manhattan distance without violating admissibility. As another example, if the top row contains the tiles (3 2 1) in that order, four more moves can be added to the Manhattan distance, since every pair of tiles is reversed, and two tiles must move out of the row temporarily. Furthermore, a tile in its goal position may be in both a row and a column conflict. Since the extra moves required to resolve a row conflict are vertical moves, and those required by a column conflict are horizontal, both sets of moves can be added to the Manhattan distance, and still preserve admissibility. This addition to the Manhattan distance heuristic reduces the number of nodes generated by IDA* on the Fifteen Puzzle by roughly an order of magnitude. The additional complexity of computing the linear conflicts slows down node generation by about a factor of two, however, for a net improvement of a factor of five. Efficiently computing this heuristic involves precomputing and storing all possible permutations of tiles in a row or column, and incrementally computing the heuristic value of a child from that of its parent. Last Moves Heuristic The next enhancement to the heuristic is based on the last moves of a solution, which must return the blank to its goal position, the upper-left corner in this case. Thus, the last move must either move the 1 tile right, or the 5 tile down. Therefore, immediately before the last move, either the 1 or 5 tile must be in the upperleft corner. Since the Manhattan distance of these tiles is computed to their goal positions, unless the 1 tile is in the left-most column, its Manhattan distance will not accommodate a path through the upper-left corner. Similarly, unless the 5 tile is in the top row, its Manhattan distance will not accommodate a path through the upper-left corner. Thus, if the 1 tile is not in the left-most column, and the 5 tile is not in the top row, we can add two moves to the Manhattan distance, and still preserve admissibility. While two moves may seem like a small improvement, it can be added to about 64% of random TwentyFour Puzzle states. The effect of two additional moves is to save an entire iteration of IDA*. Since each iteration of IDA* on the Twenty-Four Puzzle can generate up to ten times as many nodes as the previous iteration, saving an iteration can result in an order of magnitude savings in nodes generated. We can extend the same idea to the last two moves. If the last move is made by the 1 tile, the next-to-last move must either move the 2 tile right, or the 6 tile down. Similarly, if the last move is made by the 5 tile, the next-to-last move must either move the 6 tile right, or the 10 tile down. Considering the last two moves can add up to four moves to the Manhattan distance. Extending this idea to the last three moves was not cost effective on the Twenty-Four Puzzle. To benefit from both the linear conflict and last moves enhancements, and maintain admissibility, we must consider their interactions. For example, assume that the 1 tile is not in the left-most column, and the 5 tile is not in the top row. If the 1 tile is in its goal column, and in a column conflict with another tile, then the two additional moves added by the linear conflict could be used to move the 1 tile left, allowing it to pass through the upper-left corner. Similarly, if the 5 tile is in its goal row, and in a row conflict, the two additional linear conflict moves could be used to move it up and hence through the upper-left corner. Thus, if either of these conditions occur, we can’t add two more moves for the last move, since that may count twice moves already added by the linear conflict heuristic. Similarly, any additional moves added for the last two moves must also be checked against linear conflicts involving the 2, 6, and 10 tiles. In general, whenever more than one heuristic is being used, we must compute their interactions to maintain admissibility. Relation to Bidirectional Search The reader may notice that a heuristic based on the last moves in the solution is related to bi-directional search. The most effective form of bidirectional heuristic search is called perimeter search (Dillenburg and Nelson 1994) (Manzini 1995). A limited breadth-first search backward from the goal state is performed, and the nodes on the perimeter of this search are stored. IDA* is then run from the initial state, with heuristic calculations made to determine the minimum distance to any state on the perimeter. This heuristic value is then added to the distance from the initial state to the given node,

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Finding Optimal Solutions to the Twenty-Four Puzzle

We have found the rst optimal solutions to a complete set of random instances of the Twenty-Four Puzzle , the 55 version of the well-known sliding-tile puzzles. Our new contribution to this problem is a more powerful admissible heuristic function. We present a general theory for the automatic discovery of such heuristics, which is based on considering multiple sub-goals simultaneously. In addit...

متن کامل

The effect of Electronic puzzle Games on Improving Reading Performance of Students with learning disorders

The purpose of this study was to investigate the effect of Electronic puzzle Games on improving the reading performance of students with learning disorders in Gorgan. The research was applied to the target and quasi-experimental, pre-test and post-test design with control group. The statistical population consisted of 255 female students of Shokufa and Dena provincial centers and non-profit cen...

متن کامل

The Effect of Monetary Shocks on Disaggregated Prices in a Data Rich Environment: a Bayesian FAVAR Approach

Price stability has been the foremost task of monetary policy. The information relating to the response of prices to monetary policy shocks is essential for conducting monetary policy in general and for inflation targeting of central banks in particular. Most of the published empirical studies analyze the response of an aggregate price index like CPI or a consumption deflator and their r...

متن کامل

Disjoint pattern database heuristics

We describe a new technique for designing more accurate admis sible heuristic evaluation functions based on pattern databases While many heuristics such as Manhattan distance compute the cost of solving individual subgoals independently pattern databases consider the cost of solving multiple subgoals simultaneously Exist ing work on pattern databases allows combining values from di erent patter...

متن کامل

Application of the new extended (G'/G) -expansion method to find exact solutions for nonlinear partial differential equation

In recent years, numerous approaches have been utilized for finding the exact solutions to nonlinear partial differential equations. One such method is known as the new extended (G'/G)-expansion method and was proposed by Roshid et al. In this paper, we apply this method and achieve exact solutions to nonlinear partial differential equations (NLPDEs), namely the Benjamin-Ono equation. It is est...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1999